package com.seventh.associationsystem.repository;

import com.seventh.associationsystem.bean.Activity;
import com.seventh.associationsystem.bean.Association;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

public interface ActivityRepository extends JpaRepository<Activity, String>, JpaSpecificationExecutor<Activity> {
    Activity findByUid(String uid);

    Page<Activity> findByAssociationsContaining(Association association, Pageable pageable);

    List<Activity> findByAssociationsContaining(Association association);

    Page<Activity> findByNameContaining(String name, Pageable pageable);

    Page<Activity> findByField(String field, Pageable pageable);
}
